#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int func(int* str, int sz)
{
	int max = 0, tmp = 0, i;
	for (i = 0; i < sz; i++)
	{
		tmp += str[i];
		if (max < tmp)
		{
			max = tmp;
		}
	}
	return max;
}
int main()
{
	int arr[] = {-4,-3,-2,-2 ,4,3,2};
	int sz = sizeof(arr) / sizeof(arr[0]);
	int ret=func(arr, sz);
	printf("%d", ret);
	return 0;
}